home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / me_cd25.zip / MUTT2.ZIP / CSTUFF.MUT < prev    next >
Text File  |  1992-11-09  |  1KB  |  53 lines

  1.   ;; C Durland    Public Domain
  2.  
  3. (const END 78)        ;; column last character on line will be in
  4.  
  5. (defun
  6.   end-slide        ;; move text so right part ends at col
  7.   {
  8.     (int col n x)
  9.  
  10.     (n (if (arg-flag) (arg-prefix) END))
  11.     
  12.     (delete-horizontal-space)
  13.     (col (current-column))
  14.     (end-of-line)
  15.     (x (+ 1 (- n (current-column))))
  16.     (current-column col)
  17.     (to-col (+ col x))
  18.   }
  19.   MAIN
  20.   {
  21.     (bind-to-key "end-slide" "M-`")
  22.   }
  23. )
  24.  
  25. ;;/* ******************************************************************** */
  26. ;;/* *************************** Header Text **************************** */
  27. ;;/* ******************************************************************** */
  28. (defun
  29.   c-header-with-text
  30.   {
  31.     (int n len)
  32.     (string text)
  33.  
  34.     (text (ask "Header text: "))
  35. ;(n (- 66 (/ (len (length-of text)) 2)))
  36.     (n (/ (- 66 (len (length-of text))) 2))
  37.     (insert-text
  38. "/* ******************************************************************** */^J")
  39.     (insert-text "/* " 
  40.       (extract-elements
  41.         "********************************************************************"
  42.     0 n)
  43.       " " text " "
  44.       (extract-elements
  45.         "********************************************************************"
  46.     0 n)
  47.       (if (!= len (* 2 (/ len 2))) "*" "")    ;; pad odd length text
  48.       " */^J")
  49.     (insert-text
  50. "/* ******************************************************************** */^J")
  51.   }
  52. )
  53.